home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 9 / Night Owl CD-ROM (NOPV9) (Night Owl Publisher) (1993).ISO / 038a / fpchk101.zip / FPCHECK.BAS < prev    next >
BASIC Source File  |  1993-03-11  |  5KB  |  132 lines

  1. ' FPCHECK.BAS - FaxTalk(TM) Plus Send Log Check v1.01
  2. '
  3. '             Written by:  Rod L Renner, SysOp
  4. '                          The Lightning Rod BBS
  5. '                          Silver Spring MD 20904
  6. '                          phone 301-622-0708 (SupraFAX v.32bis)
  7. '
  8. '             This program is used in conjunction with Mark Herring's
  9. '             PCB/FaxMail v1.01 gateway to provide the VERIFY function
  10. '             when using FAXTalk Plus facsimile software.  It reads the
  11. '             last entry in the SEND.LOG file and writes the OK file in
  12. '             the current directory based on the last entry.
  13. '             The possible entries in the first line of the OK file are:
  14. '                 SUCCESS     - the file was successfully sent
  15. '                 BUSY        - the phone was busy
  16. '                 NOGOOD      - any other condition including inability
  17. '                               for this program to read the SEND.LOG file.
  18. '
  19. '             If line 1 reports SUCCESS, line 2 of the OK file contains
  20. '             the word "STATUS: " followed by additional information
  21. '             from the log entry, including the status from the log,
  22. '             the fax transmission time, connect speed, and recipient
  23. '             fax's ID.  If line 2 reports BUSY or NOGOOD, additional
  24. '             information in line 2 may give an indication as to the
  25. '             problem.
  26. '
  27. ' Calling sequence (in FaxMail's VERIFY command line):     
  28. '
  29. '             FPCHECK </B>  <filename-of-SEND.LOG>
  30. '     where:
  31. '             </B> tells FPCHECK to return a BUSY instead of a NOGOOD status
  32. '             if the log file reports 'Failed'.  This is used to allow the
  33. '             system to reschedule the fax via the /BUSY command.  At least
  34. '             once in awhile, FPCHECK should be called w/o the /B to prevent
  35. '             an infinite BUSY loop caused by a failure to connect.
  36. '
  37. '             <filename-of-SEND.LOG> is the path and filename of the
  38. '             SEND.LOG file created by the FaxTalk Plus software
  39. '             (FAXPLUS.EXE or SENDAFAX.EXE).  If this parameter is omitted,
  40. '             FPCHECK assumes the name SEND.LOG in the default directory.
  41. '
  42. '             FPCHECK always writes the file OK in the default directory.
  43. '                                  ------------
  44. '             The program FPCHECK.BAS is Copyright 1993 by Rod L. Renner
  45. '
  46. '             The program is provided free of charge and may be run or
  47. '             modified by the user for personal use. This file may also be
  48. '             distributed so long as this original source code including all
  49. '             remarks and documentation is not altered and is included with
  50. '             distribution.
  51. '
  52. '             This program has been successfully tested using FaxTalk Plus
  53. '             v1.65c for the SupraFAXModem(TM) v.32bis.  However, this
  54. '             program is provided AS IS and WITHOUT WARRANTY OF ANY KIND.
  55. '             Use at your own personal risk and expense!
  56. '
  57. '             FPCHECK was written and compiled in Microsoft QuickBASIC v4.5
  58. '
  59. '             FaxTalk(TM) is a Trademark of Thought Communications, Inc.
  60. '             PCB/FaxMail 1.01 is Copyright 1993 by Mark Herring.
  61. '             SupraFAXModem is a Trademark of Supra Corporation.
  62. '
  63. '  History:   03/08/93 - Release of version 1.0
  64. '             03/11/93 - Release of version 1.01  - added the /B option
  65. '
  66. '
  67. DEFINT A-Z
  68. DIM logstat$(14), status$(14)
  69. FOR i = 0 TO 14: READ logstat$(i): NEXT i
  70. FOR i = 0 TO 14: READ status$(i): NEXT i
  71. DATA LogErr,NoMatch,Abort,Busy,Failed,NoAns,NoLine,NoFile,Sent,SentBF
  72. DATA SentEC,No BFT,No 2-D,ERR 01,ERR 02
  73. DATA NOGOOD,NOGOOD,NOGOOD,BUSY,NOGOOD,NOGOOD,NOGOOD,NOGOOD,SUCCESS,SUCCESS
  74. DATA SUCCESS,NOGOOD,NOGOOD,NOGOOD,NOGOOD
  75. PRINT "FPCHECK v1.01 - Copyright 1993 by Rod L. Renner - Freeware"
  76. PRINT "Check status of last entry in FaxTalk(TM) Plus' SEND.LOG file"
  77.  
  78. l$ = UCASE$(COMMAND$)
  79. IF LEN(l$) > 0 THEN
  80.    i = INSTR(l$, "/B")
  81.    IF i > 0 THEN
  82.       status$(4) = "BUSY"
  83.       l$ = LEFT$(l$, i - 1) + MID$(l$, i + 2)
  84.    END IF
  85. END IF
  86. l$ = LTRIM$(RTRIM$(l$))
  87. IF LEN(l$) = 0 THEN l$ = "SEND.LOG"
  88.  
  89. ON ERROR GOTO oops
  90. OPEN "I", 1, l$
  91. i$ = INPUT$(2, 1)
  92. nentry = CVI(i$) + 1
  93. IF nentry <= 0 THEN GOTO logerr
  94.  
  95. i$ = INPUT$(2, 1)
  96. loglength = CVI(i$) + 2
  97. IF loglength < 76 THEN GOTO logerr
  98.  
  99. FOR i = 1 TO nentry
  100.   IF EOF(1) THEN GOTO logerr
  101.   i$ = INPUT$(loglength, 1)
  102.   IF ASC(RIGHT$(i$, 1)) <> 0 THEN GOTO logerr
  103. NEXT i
  104.  
  105. lstatus$ = RTRIM$(MID$(i$, 70, 6))
  106.  
  107. FOR nlog = 2 TO 14
  108.    IF lstatus$ = logstat$(nlog) THEN GOTO wrtstatus
  109. NEXT nlog
  110.  
  111. nlog = 1
  112.  
  113. wrtstatus:
  114. IF nlog > 0 THEN
  115.    extra$ = RTRIM$(MID$(i$, 70, loglength - 70)) + RTRIM$("  " + MID$(i$, 29, 21))
  116. END IF
  117.  
  118. OPEN "O", 2, "OK"
  119. PRINT #2, status$(nlog)
  120. PRINT #2, "STATUS: "; extra$
  121. CLOSE
  122. PRINT "OK file: "; status$(nlog)
  123. PRINT "         STATUS: "; extra$
  124. END
  125.  
  126. oops:
  127. RESUME logerr
  128. logerr:
  129. nlog = 0: extra$ = "Something is wrong with the log file: " + l$
  130. GOTO wrtstatus
  131.  
  132.